import {requestDel, requestGet, requestPost} from "./request";

const baseUrl = '/alarm/'

// channel,//频道id
//   alarm_log_type,//异常类型：D(不匹配)，B(采集器信号中断)
//   start,
//   end,
//   channel_type,//链路类型
//   channel_name,//链路名称模糊搜索
//   page = 1,
//   page_size = 2
export async function getAlarmList(params) {

	return await requestGet(`${baseUrl}`, params)
}

export async function handleAlarm({id, handler, result = 'C', sample_media_url, meta_media_url}) {
	return await requestPost(`${baseUrl}${id}/handle_alarm/`, {
		handler, result, sample_media_url, meta_media_url
	})
}

export async function deleteAlarm(id) {
	return await requestDel(baseUrl + id)
}

export async function handleAllAlarm(channelUrl, result) {
	return await requestPost(`${baseUrl}handle_channel_alarms/`, {channel: channelUrl, result})
}


